package com.myCommunity.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.myCommunity.dao.RoleDao;
import com.myCommunity.entity.Role;
@Repository("roleDao")
public class RoleDaoImpl extends BeseDao implements RoleDao{

	public List<Role> getAll() {
		List<Role> list =(List<Role>) getHibernateTemplate().find("from Role");
		return list;
	}

	public Role getById(int id) {
		String hql="from Role r where r.id=?";
		Role role = (Role) getHibernateTemplate().find(hql,id);
		return role;
	}

}
